package com.ymm.driver.dao.mapper;

import com.ymm.driver.api.constants.Entity.NoticeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author rg
 */
@Mapper
public interface DriverNoticeMapper {
    void add(NoticeEntity notice);

    NoticeEntity getByNoticeId(Long noticeId);

    void setReadStatus(@Param("noticeId") Long noticeId, @Param("isRead") Boolean isRead);

    int countNoticeUnread(Long driverId);

    int countNoticeUnreadByNoticeType(@Param("driverId") Long driverId, @Param("noticeType") Integer noticeType);

    List<NoticeEntity> listNoticesByNoticeIds(List<Long> noticeIds);

    void batchSetReadStatus(@Param("noticeIds") List<Integer> noticeIds, @Param("isRead") boolean isRead);

    List<NoticeEntity> listNoticesByDriverId(Long driverId);

    List<NoticeEntity> listNoticesByDriverIdAndNoticeType(@Param("driverId") Long driverId, @Param("noticeType") Integer noticeType);
}
